<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 10300
  Date: 2021/10/24
  Time: 17:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
        <meta charset="UTF-8">
        <title>会员信息</title>
        <link type="text/css" rel="stylesheet" href="fontsawesome/css/font-awesome.css"/>
        <link type="text/css" rel="stylesheet" href="css/style.css"/>
    </head>
<body>
<div class="main_box">
    <h2><span></span>会员信息</h2>
    <form action="${pageContext.request.contextPath}/findIDR" method="get">
    <div class="search_box clearfix">

        <label class="f_left">搜索会员：</label>
        <input type="search" name="vname"  placeholder="请输入手机号/车牌号/姓名" class="f_left search_input"/>
        <input type="submit" value="搜索"/>

    </div></form>
    <div class="cont_box">
        <ul class="tab_tit clearfix">
            <li>会员基本信息</li>
            <li>爱车</li>
            <li>储值卡</li>
            <li>年卡</li>
            <li>大礼包</li>
            <li>消费记录</li>
            <li>积分记录</li>
        </ul>
        <dl class="tab_conbox">
            <!--会员基本信息-->
            <dd>
                <form action="${pageContext.request.contextPath}/updateVip" method="get">
                    <input name="vid" value="${idr1.vid}" type="hidden">
                    <div class="addpro_box clearfix">
                        <label>姓名：</label>
                        <input type="text" value="${idr1.vname}" name="vname" required data-rule-fullname="true" data-msg-required="会员姓名不能为空"/>
                    </div>
                    <div class="addpro_box clearfix">
                        <label>手机号：</label>
                        <input type="text" value="${idr1.phone}" name="phone" required data-rule-mobile="true" data-msg-required="会员手机号不能为空"/>
                    </div>
                    <div class="addpro_box clearfix">
                        <label>所属门店：</label>
                        <input type="text" name="shop" value="${idr1.shop}" />
                    </div>
                    <div class="addpro_box learfix">
                        <label>注册来源：</label>
                        <input type="text" name="source" value="${idr1.source}" readonly/>
                    </div>
                    <div class="probtn_box clearfix">
                        <input type="submit" value="保存修改" class="btn blue_btn submit">
                    </div>
                </form>
            </dd>
            <!--爱车-->
            <dd>
                <div class="margin_tb clearfix">
                    <a href="add_Car.jsp"class="btn blue_btn add_car"> 添加爱车</a>
                </div>
                <!--爱车信息-->
                <c:forEach items="${car}" var="car">
                <div class="ucar_list">
                    <h5>
                        <span>爱车编号${car.cid}</span>
                        <a href="${pageContext.request.contextPath}/findIdCar?cid=${car.cid}">编辑车辆信息</a>
                        <a href="${pageContext.request.contextPath}/deleteCar?cid=${car.cid}" >删除车辆</a>
                    </h5>
                    <table border="0" cellspacing="0" cellpadding="0" class="table">
                        <tbody>
                        <tr>
                            <td>品牌</td>
                            <td>${car.brand}</td>
                            <td>系列</td>
                            <td>${car.series}</td>
                        </tr>
                        <tr>
                            <td>型号</td>
                            <td>${car.model}</td>
                            <td>发动机号</td>
                            <td>${car.engine_id}</td>
                        </tr>
                        <tr>
                            <td>车牌号</td>
                            <td>${car.bus_id}</td>
                            <td>车架号</td>
                            <td>${car.vin_id}</td>
                        </tr>
                        <tr>
                            <td>行驶证</td>
                            <td>${car.driving}</td>
                            <td>年份</td>
                            <td>
                                <fmt:formatDate value="${car.year}"></fmt:formatDate>
                                  </td>
                        </tr>
                        <tr>
                            <td>指导价</td>
                            <td>${car.price}</td>
                            <td>保险到期日</td>
                            <td>

                                <fmt:formatDate value="${car.safe}"></fmt:formatDate>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div></c:forEach>

            <!--储值卡-->
            <dd>
                <!--当前储值卡为空时显示添加按钮-->
                <div class="margin_tb clearfix">
                    <a href="add_Pcard.jsp" class="btn blue_btn add_pcard">添加储值卡</a>
                </div>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>

                    <tr>
                        <th>用户手机号</th>
                        <th>卡片ID</th>
                        <th>卡片种类</th>
                        <th>卡片余额</th>
                        <th>卡片折扣</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                <c:forEach items="${pet}" var="pet">
                    <tr id="${pet.pid}"><!--这里id为卡片操作时需要-->
                        <td>${pet.phone}</td>
                        <td>${pet.pid}</td>
                        <td>${pet.kind}</td>
                        <td>${pet.money}</td>
                        <td>${pet.discount}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/findIdSj?pid=${pet.pid}" class="table_btn table_edit upgrade_btn">
                                <i class="fa fa-thumbs-up"></i>
                                <span>卡片升级</span>
                            </a>
                            <a href="${pageContext.request.contextPath}/findIdPet_card?pid=${pet.pid}" class="table_btn table_info recharge_btn">
                                <i class="fa fa-mail-forward"></i>
                                <span>卡片充值</span>
                            </a>
                            <a href="${pageContext.request.contextPath}/kxq?pid=${pet.pid}" class="table_btn table_del ">
                                <i class="fa fa-trash-o"></i>
                                <span>删除卡片</span>
                            </a>
                        </td>
                    </tr></c:forEach>
                    </tbody>
                </table>
            </dd>
            <!--年卡-->
            <dd>
                <!--当前年为空时显示添加按钮-->
                <div class="margin_tb clearfix">
                    <a href="add_Ycard.jsp" class="btn blue_btn add_ycard">添加年卡</a>
                </div>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>

                    <tr>
                        <th>用户手机号</th>
                        <th>用户姓名</th>
                        <th>卡片额度</th>
                        <th>绑定车牌号</th>
                        <th>办理日期</th>
                        <th>过期日期</th>
                        <th>状态</th>
                    </tr>
                    </thead>
                    <tbody>  <c:forEach items="${year1}" var="year1">
                    <tr>
                        <td>${year1.phone}</td>
                        <td>${year1.yname}</td>
                        <td>${year1.money}</td>
                        <td>${year1.bus_id}</td>
                        <td>
                            <fmt:formatDate value="${year1.star_regtime}"></fmt:formatDate></td>
                        <td>
                            <fmt:formatDate value="${year1.last_regtime}"></fmt:formatDate></td>
                        <td><c:choose>
                            <c:when test="${year1.status=='0'}">可用</c:when>
                            <c:when test="${year1.status=='1'}">不可用</c:when>
                        </c:choose></td>
                    </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </dd>
            <!--大礼包-->
            <dd>
                <div class="margin_tb clearfix">
                    <a href="add_Spree.jsp" class="btn blue_btn add_spree">添加大礼包</a>
                </div>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>用户手机号</th>
                        <th>大礼包</th>
                        <th>大礼包价格</th>
                        <th>办理日期</th>
                        <th>过期日期</th>
                        <th>大礼包详情</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${gift1}" var="gift1">
                    <tr>
                        <td>${gift1.phone}</td>
                        <td>${gift1.gname}</td>
                        <td>${gift1.price}</td>
                        <td>
                            <fmt:formatDate value="${gift1.star_regtime}"></fmt:formatDate></td>
                        <td>
                            <fmt:formatDate value="${gift1.last_trgtime}"></fmt:formatDate></td>
                        <td><c:choose>
                            <c:when test="${gift1.datails=='0'}">可用</c:when>
                            <c:when test="${gift1.datails=='1'}">不可用</c:when>
                        </c:choose></td>
                    </tr></c:forEach>
                    </tbody>
                </table>
            </dd>
            <!--消费记录-->
            <dd>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>订单号</th>
                        <th>消费金额</th>
                        <th>会员</th>
                        <th>手机号</th>
                        <th>支付</th>
                        <th>状态</th>
                        <th>开单日期</th>
                        <th>订单备注</th>
                        <th>所属门店</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${calendarVip}" var="calendarVip">
                    <tr>
                        <td>${calendarVip.order_id}</td>
                        <td>${calendarVip.money}</td>
                        <td>${calendarVip.vip}</td>
                        <td>${calendarVip.phone}</td>
                        <td>${calendarVip.pay}</td>
                       <td> <c:choose>
                            <c:when test="${calendarVip.status=='0'}">已支付</c:when>
                            <c:when test="${calendarVip.status=='1'}">未支付</c:when>
                        </c:choose></td>
                        <td>  <fmt:formatDate value="${calendarVip.star_regtime}"></fmt:formatDate></td>
                        <td>${calendarVip.remark}</td>
                        <td>${calendarVip.store}</td>
                    </tr></c:forEach>

                    </tbody>
                </table>
            </dd>
            <!--积分记录-->
            <dd>
                <table border="0" cellspacing="0" cellpadding="0" class="table">
                    <thead>
                    <tr>
                        <th>会员</th>
                        <th>手机号</th>
                        <th>原积分</th>
                        <th>状态</th>
                        <th>积分变动</th>
                        <th>当前积分</th>
                        <th>操作类型</th>
                        <th>操作日期</th>
                    </tr>
                    </thead>
                    <tbody><c:forEach items="${integralVip}" var="integralVip">
                    <tr>
                        <td>${integralVip.vip}</td>
                        <td>${integralVip.phone}</td>
                        <td>${integralVip.integral}</td>
                        <td><c:choose>
                            <c:when test="${integralVip.status=='0'}">增加</c:when>
                            <c:when test="${integralVip.status=='1'}">减少</c:when>
                        </c:choose>
                              </td>
                        <td>${integralVip.jifen}</td>
                        <td>${integralVip.present}</td>
                        <td>${integralVip.style}</td>
                        <td>
                            <fmt:formatDate value="${integralVip.now_regtime}"></fmt:formatDate></td>
                    </tr></c:forEach>
                    </tbody>
                </table>
            </dd>
        </dl>
    </div>
</div>
<!--javascript include-->
<script src="js/jquery-2.2.1.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/other1.js"></script>
<script>
    $(function(){
        $.jqtab(".tab_tit",".tab_conbox","click");
        var addCar = "",//添加爱车时所需id
            editCar = "",//添加爱车时所需id
            delCar = "",//添加爱车时所需id
            addYcard = "",//添加爱车时所需id
            addSpree = "",//添加爱车时所需id
            addPcard = "",//添加爱车时所需id
            delPcard = "";//添加爱车时所需id

        //$("body").tipWindow({method:"edit",type:"form",Class:".add_car",even:"click",dataId:addCar,tipTit:"添加爱车",Twidth:"700",Theight:"520",editUrl:"add_Car.jsp"});//editUrl 添加爱车请求地址
        //  $("body").tipWindow({method:"edit",type:"form",Class:".edit_car",even:"click",dataId:editCar,tipTit:"编辑爱车",Twidth:"700",Theight:"520",editUrl:"${pageContext.request.contextPath}/findIdCar"});//editUrl 编辑爱车请求地址
        //$("body").tipWindow({method:"delete",Class:".del_car",even:"click",dataId:delCar,Twidth:"400",Theight:"180",delUrl:"#"});//delUrl 删除爱车请求地址
       // $("body").tipWindow({method:"",type:"form",Class:".add_ycard",even:"click",dataId:addYcard,tipTit:"添加年卡",Twidth:"600",Theight:"400",editUrl:"add_Ycard.jsp"});//editUrl 添加年卡请求地址
       // $("body").tipWindow({method:"",type:"form",Class:".add_spree",even:"click",dataId:addSpree,tipTit:"添加大礼包",Twidth:"600",Theight:"520",editUrl:"add_Spree.jsp"});//editUrl 添加大礼包请求地址
        //$("body").tipWindow({method:"edit",type:"form",Class:".add_pcard",even:"click",dataId:addPcard,tipTit:"添加储值卡",Twidth:"600",Theight:"400",editUrl:"add_Pcard.jsp"});//editUrl 添加储值卡请求地址
        //$("body").tipWindow({method:"delete",Class:".del_btn",even:"click",Twidth:"400",dataId:delPcard,Theight:"180",delUrl:""});//delUrl 删除储值卡请求地址
        //$("body").tipWindow({method:"edit",type:"form",Class:".upgrade_btn",even:"click",tipTit:"储值卡升级",Twidth:"600",Theight:"360",editUrl:"pcard_Upgrade.jsp"});//editUrl 储值卡升级请求地址
        //$("body").tipWindow({method:"edit",type:"form",Class:".recharge_btn",even:"click",tipTit:"储值卡充值",Twidth:"600",Theight:"300",editUrl:"${pageContext.request.contextPath}/findIdPet_card"});//editUrl 储值卡充值请求地址
        //查询会员获取信息
        var userId =  $(this).parents("input").prop("id");;//会员id
        $(".search").click(function(){
            $.ajax({

                type:"get",
                url:"${pageContext.request.contextPath}/findIDR",
                data:{"vname":userId},
                success:function(data){

                },
                error:function(data){
                    alert("查询失败，请重试！");
                }
            });
        });

    });
</script>

</body>
</html>
